<?php
/**
 * @package Joomla
 * @subpackage Jcampaignmonitor
 * @copyright (C) 2010 - Matthieu BARBE - www.ccomca.com
 * @license GNU/GPL v2
 * 
 * Jcampaignmonitor is a derivative work of the excellent Campaign Monitor Module (from Van Eldijk Studios) and CampaignMonitor Ajax subscription Module (from Joomailer)
 * see http://www.vaneldijk.nl/ and http://www.joomailer.com/ for more information
 *
 * Jcampaignmonitor uses :
 * CampaignMonitorLib (CMBase.php => http://code.google.com/p/campaignmonitor-php/)
 * json class by Michal Migurski, Matt Knapp, Brett Stimmerman
 * 1 000 free "Farm Fresh Web Icons" => http://www.fatcow.com/free-icons/
 * extendedlistnamevalue.php & extendedlist.js are inspired by RocketTheme !
 *
 * Jcampaignmonitor is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
defined('JPATH_BASE') or die();

class JElementPhpCheck extends JElement
{
	var	$_name = 'PhpCheck';
    var $_error = null;

	function fetchElement($name, $value, &$node, $control_name)
	{
		
		if (version_compare(PHP_VERSION, '5.0.0', '<'))
			{
				$msg ='<div style="background: #FFD5D5;color: #ff0000;padding:5px"> <img src="../plugins/system/elements-janalyticsvirtuemart/images/alert.png" alt ="" align="absmiddle" vspace="5" /> '.sprintf (JText::_( 'JAV_PHP_NOOK'), PHP_VERSION).'</div>';
			}
			else
			{
				$msg ='<div style="background: #e4f3e2;color: #000;padding:5px"> <img src="'.JURI::root(true).'../plugins/system/elements-janalyticsvirtuemart/images/approved.png" alt ="" align="absmiddle" vspace="5" /> '.sprintf ( JText::_( 'JAV_PHP_OK' ),  PHP_VERSION).'</div>';
			}
			return $msg;
	}
}